<?php 
error_reporting(E_ALL);
include ("config.inc.php");

	// CLIENT INFORMATION
	$c_id    = escape('c_id');
	$p_title = escape('p_title');
	$p_url   = escape('p_url');
	$cat_id  = escape('cat_id');
	
	// FTP INFORMATION
	$ftp_address  = escape('ftp_address');
	$ftp_username = escape('ftp_username');
	$ftp_password = escape('ftp_password');
	
	// HOSTING INFORMATION
	$host_name      = escape('host_name');
	$host_address   = escape('host_address');
	$host_username  = escape('host_username');
	$host_password  = escape('host_password');

    $add_project  = "INSERT INTO projects (c_id,p_title,p_url,cat_id,ftp_address,ftp_username,ftp_password,host_name,host_address,host_username,host_password,date_started) VALUES ('$c_id','$p_title','$p_url','$cat_id','$ftp_address','$ftp_username','$ftp_password','$host_name','$host_address','$host_username','$host_password',NOW())";
    mysql_query($add_project) or die(mysql_error());
	$p_id = mysql_insert_id();
	$pagearray = explode(',',escape('page'));

	foreach($pagearray as $thispage){
		$thispage = trim($thispage);
		if(get_magic_quotes_gpc()) {
			$thispage = stripslashes($thispage);
		}  
		$add_pages_query = "INSERT INTO pages (page_name,p_id,c_id) VALUES ('$thispage','$p_id','$c_id')";
		$add_pages = mysql_query($add_pages_query) or die(mysql_error());
	}
?>